var http = require('http');
var User = require("./models/User");
var Teacher = require("./models/Teacher")
http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
  if(request.url !== '/favicon.ico') { //清除第二次访问
    //user = new User(1, '张三', 20);
    teacher = new Teacher(1, '张三', 20);
    // user.id = 1;
    // user.name = "张三";
    // user.age = 20;
    //user.enter();
    teacher.enter();
    teacher.teach(response);
    response.end(); //不写则没有http协议尾,但是写了会产生两次访问
  }
}).listen(8000);
console.log('Server running at http://localhost:8000/');
